<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller {
    public function index()
    {

        // $this->load->model('User_model');

        // $data = $this->User_model->get_last_ten();

        // var_dump($data);

        // $query = $this->db->query('SELECT * FROM fly_user order by uid desc');
        
        $query = $this->db->where('sex','男')->get('fly_user');

        // Db:table('fly_user')->select();

        var_dump($query->result_array());



        $this->load->view('public/abc',['name'=>'学并思','title'=>'标题']);
    }

    public function code($value='')
    {
        $this->load->helper('captcha');

        $vals = array(
            'word'      => 'wesrtert',
            'img_path'  => './captcha/',
            'img_url'   => '/P201801/ci/captcha/',
            'font_path' => './path/to/fonts/texb.ttf',
            'img_width' => '150',
            'img_height'    => 60,
            'expiration'    => 7200,
            'word_length'   => 8,
            'font_size' => 40,
            'img_id'    => 'Imageid',
            'pool'      => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ',

            // White background and border, black text and red grid
            'colors'    => array(
                'background' => array(255, 255, 255),
                'border' => array(255, 255, 255),
                'text' => array(0, 0, 0),
                'grid' => array(255, 40, 40)
            )
        );

        $cap = create_captcha($vals);

        // var_dump($cap);
        echo $cap['image'];

    }
}
